# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Language.V1.Model.XPSEvaluationMetrics do
  @moduledoc """
  Contains xPS-specific model evaluation metrics either for a single annotation spec (label), or for the model overall. Next tag: 18.

  ## Attributes

  *   `annotationSpecIdToken` (*type:* `String.t`, *default:* `nil`) - The annotation_spec for which this evaluation metrics instance had been created. Empty iff this is an overall model evaluation (like Tables evaluation metrics), i.e. aggregated across all labels. The value comes from the input annotations in AnnotatedExample. For MVP product or for text sentiment models where annotation_spec_id_token is not available, set label instead.
  *   `category` (*type:* `integer()`, *default:* `nil`) - The integer category label for which this evaluation metric instance had been created. Valid categories are 0 or higher. Overall model evaluation should set this to negative values (rather than implicit zero). Only used for Image Segmentation (prefer to set annotation_spec_id_token instead). Note: uCAIP Image Segmentation should use annotation_spec_id_token.
  *   `evaluatedExampleCount` (*type:* `integer()`, *default:* `nil`) - The number of examples used to create this evaluation metrics instance.
  *   `imageClassificationEvalMetrics` (*type:* `GoogleApi.Language.V1.Model.XPSClassificationEvaluationMetrics.t`, *default:* `nil`) - 
  *   `imageObjectDetectionEvalMetrics` (*type:* `GoogleApi.Language.V1.Model.XPSImageObjectDetectionEvaluationMetrics.t`, *default:* `nil`) - 
  *   `imageSegmentationEvalMetrics` (*type:* `GoogleApi.Language.V1.Model.XPSImageSegmentationEvaluationMetrics.t`, *default:* `nil`) - 
  *   `label` (*type:* `String.t`, *default:* `nil`) - The label for which this evaluation metrics instance had been created. Empty iff this is an overall model evaluation (like Tables evaluation metrics), i.e. aggregated across all labels. The label maps to AnnotationSpec.display_name in Public API protos. Only used by MVP implementation and text sentiment FULL implementation.
  *   `regressionEvalMetrics` (*type:* `GoogleApi.Language.V1.Model.XPSRegressionEvaluationMetrics.t`, *default:* `nil`) - 
  *   `tablesClassificationEvalMetrics` (*type:* `GoogleApi.Language.V1.Model.XPSClassificationEvaluationMetrics.t`, *default:* `nil`) - 
  *   `tablesEvalMetrics` (*type:* `GoogleApi.Language.V1.Model.XPSTablesEvaluationMetrics.t`, *default:* `nil`) - 
  *   `textClassificationEvalMetrics` (*type:* `GoogleApi.Language.V1.Model.XPSClassificationEvaluationMetrics.t`, *default:* `nil`) - 
  *   `textExtractionEvalMetrics` (*type:* `GoogleApi.Language.V1.Model.XPSTextExtractionEvaluationMetrics.t`, *default:* `nil`) - 
  *   `textSentimentEvalMetrics` (*type:* `GoogleApi.Language.V1.Model.XPSTextSentimentEvaluationMetrics.t`, *default:* `nil`) - 
  *   `translationEvalMetrics` (*type:* `GoogleApi.Language.V1.Model.XPSTranslationEvaluationMetrics.t`, *default:* `nil`) - 
  *   `videoActionRecognitionEvalMetrics` (*type:* `GoogleApi.Language.V1.Model.XPSVideoActionRecognitionEvaluationMetrics.t`, *default:* `nil`) - 
  *   `videoClassificationEvalMetrics` (*type:* `GoogleApi.Language.V1.Model.XPSClassificationEvaluationMetrics.t`, *default:* `nil`) - 
  *   `videoObjectTrackingEvalMetrics` (*type:* `GoogleApi.Language.V1.Model.XPSVideoObjectTrackingEvaluationMetrics.t`, *default:* `nil`) - 
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :annotationSpecIdToken => String.t() | nil,
          :category => integer() | nil,
          :evaluatedExampleCount => integer() | nil,
          :imageClassificationEvalMetrics =>
            GoogleApi.Language.V1.Model.XPSClassificationEvaluationMetrics.t() | nil,
          :imageObjectDetectionEvalMetrics =>
            GoogleApi.Language.V1.Model.XPSImageObjectDetectionEvaluationMetrics.t() | nil,
          :imageSegmentationEvalMetrics =>
            GoogleApi.Language.V1.Model.XPSImageSegmentationEvaluationMetrics.t() | nil,
          :label => String.t() | nil,
          :regressionEvalMetrics =>
            GoogleApi.Language.V1.Model.XPSRegressionEvaluationMetrics.t() | nil,
          :tablesClassificationEvalMetrics =>
            GoogleApi.Language.V1.Model.XPSClassificationEvaluationMetrics.t() | nil,
          :tablesEvalMetrics => GoogleApi.Language.V1.Model.XPSTablesEvaluationMetrics.t() | nil,
          :textClassificationEvalMetrics =>
            GoogleApi.Language.V1.Model.XPSClassificationEvaluationMetrics.t() | nil,
          :textExtractionEvalMetrics =>
            GoogleApi.Language.V1.Model.XPSTextExtractionEvaluationMetrics.t() | nil,
          :textSentimentEvalMetrics =>
            GoogleApi.Language.V1.Model.XPSTextSentimentEvaluationMetrics.t() | nil,
          :translationEvalMetrics =>
            GoogleApi.Language.V1.Model.XPSTranslationEvaluationMetrics.t() | nil,
          :videoActionRecognitionEvalMetrics =>
            GoogleApi.Language.V1.Model.XPSVideoActionRecognitionEvaluationMetrics.t() | nil,
          :videoClassificationEvalMetrics =>
            GoogleApi.Language.V1.Model.XPSClassificationEvaluationMetrics.t() | nil,
          :videoObjectTrackingEvalMetrics =>
            GoogleApi.Language.V1.Model.XPSVideoObjectTrackingEvaluationMetrics.t() | nil
        }

  field(:annotationSpecIdToken)
  field(:category)
  field(:evaluatedExampleCount)

  field(:imageClassificationEvalMetrics,
    as: GoogleApi.Language.V1.Model.XPSClassificationEvaluationMetrics
  )

  field(:imageObjectDetectionEvalMetrics,
    as: GoogleApi.Language.V1.Model.XPSImageObjectDetectionEvaluationMetrics
  )

  field(:imageSegmentationEvalMetrics,
    as: GoogleApi.Language.V1.Model.XPSImageSegmentationEvaluationMetrics
  )

  field(:label)
  field(:regressionEvalMetrics, as: GoogleApi.Language.V1.Model.XPSRegressionEvaluationMetrics)

  field(:tablesClassificationEvalMetrics,
    as: GoogleApi.Language.V1.Model.XPSClassificationEvaluationMetrics
  )

  field(:tablesEvalMetrics, as: GoogleApi.Language.V1.Model.XPSTablesEvaluationMetrics)

  field(:textClassificationEvalMetrics,
    as: GoogleApi.Language.V1.Model.XPSClassificationEvaluationMetrics
  )

  field(:textExtractionEvalMetrics,
    as: GoogleApi.Language.V1.Model.XPSTextExtractionEvaluationMetrics
  )

  field(:textSentimentEvalMetrics,
    as: GoogleApi.Language.V1.Model.XPSTextSentimentEvaluationMetrics
  )

  field(:translationEvalMetrics, as: GoogleApi.Language.V1.Model.XPSTranslationEvaluationMetrics)

  field(:videoActionRecognitionEvalMetrics,
    as: GoogleApi.Language.V1.Model.XPSVideoActionRecognitionEvaluationMetrics
  )

  field(:videoClassificationEvalMetrics,
    as: GoogleApi.Language.V1.Model.XPSClassificationEvaluationMetrics
  )

  field(:videoObjectTrackingEvalMetrics,
    as: GoogleApi.Language.V1.Model.XPSVideoObjectTrackingEvaluationMetrics
  )
end

defimpl Poison.Decoder, for: GoogleApi.Language.V1.Model.XPSEvaluationMetrics do
  def decode(value, options) do
    GoogleApi.Language.V1.Model.XPSEvaluationMetrics.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Language.V1.Model.XPSEvaluationMetrics do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
